//
//  HJVideoConst.h
//  HJVideoPlayer
//
//  Created by WHJ on 2018/1/26.
//  Copyright © 2018年 WHJ. All rights reserved.
//

#ifndef HJVideoConst_h
#define HJVideoConst_h


/**********************   CONSTS  ***********************/

#define kVideoFullFrame              [UIScreen mainScreen].bounds
#define kVideoScreenW                [UIScreen mainScreen].bounds.size.width
#define kVideoScreenH                [UIScreen mainScreen].bounds.size.height


#define kVideoMaskViewBGColor [[UIColor blackColor] colorWithAlphaComponent:.3]

#define kVideoBottomGradientColor [[UIColor blackColor] colorWithAlphaComponent:.5]

#pragma mark - UIColor宏定义
#define UIColorFromRGBA(rgbValue, alphaValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0x0000FF))/255.0 \
alpha:alphaValue]

#define UIColorFromRGB(rgbValue) UIColorFromRGBA(rgbValue, 1.0)
#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]   // RGBA 颜色值、透明度


// 屏幕尺寸
#define MC_SCREEN_WIDTH   (([[UIScreen mainScreen] bounds].size.width < [[UIScreen mainScreen] bounds].size.height) ? [[UIScreen mainScreen] bounds].size.width : [[UIScreen mainScreen] bounds].size.height)
#define MC_SCREEN_HEIGHT  (([[UIScreen mainScreen] bounds].size.height > [[UIScreen mainScreen] bounds].size.width) ? [[UIScreen mainScreen] bounds].size.height : [[UIScreen mainScreen] bounds].size.width)
#define MC_SCREEN_BOUNDS  [UIScreen mainScreen].bounds
// 屏幕宽度的比例
#define MCScreenWidthScale ((MC_SCREEN_WIDTH) / 375.0)
// 屏幕高度的比例
#define MCScreenHeightScale ((MC_SCREEN_HEIGHT) / 667.0)
// UI适配
#define MCAutoLayout(value) ((value) * MCScreenWidthScale)
#define MCFont(font) [UIFont systemFontOfSize:((font) * MCScreenWidthScale)]
#define MCBoldFont(font) [UIFont boldSystemFontOfSize:((font) * MCScreenWidthScale)]
#define IsIPhoneX ([[UIApplication sharedApplication] statusBarFrame].size.height == 44 ? YES : NO)

static CGFloat const kDefaultAnimationDuration = 0.35f;

static CGFloat const kTopBarHalfHeight = 44.f;
static CGFloat const kTopBarFullHeight = 44.f;
static CGFloat const kBottomBarHalfHeight = 44.f;
static CGFloat const kBottomBarFullHeight = 44.f;

/**********************   Images  ***********************/

#define imgFullScreen   [UIImage imageFromBundleWithName:@"video_toFullScreen_white"]
#define imgHalfScreen   [UIImage imageFromBundleWithName:@"video_toHalfScreen_white"]
#define imgSliderThumb  [UIImage imageFromBundleWithName:@"video_slider_thumb"]

#define imgVideoBackImg [UIImage imageFromBundleWithName:@"video_bg.jpg"]

#define imgPlay         [UIImage imageNamed:@"video_play"]
#define imgPause        [UIImage imageNamed:@"video_pause"]
#define imgBack         [UIImage imageNamed:@"video_back"]

/**********************   methods  ***********************/
// weakSelf
#define WS(weakSelf) __weak __typeof(&*self) weakSelf = self
// 播放器高度 16：9
#define VideoH(width) (width*9/16.f)


/**********************   Notifications  ***********************/
// 切换屏幕通知
#define kNotificationChangeScreen  @"NotificationChangeScreen"
#define kNotificationPlayVideo     @"NotificationPlayVideo"
#define kNotificationPauseVideo    @"NotificationPauseVideo"







#endif /* HJVideoConst_h */
